﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data.SqlClient;
using System.Data;
using Exam.Core.DBUtility;
using System.Data.OleDb;
using System.Collections;

namespace Exam.Core.SQLDAL
{
    public class DataProvider {

        public static bool Exists(string sql) {
            return DbHelperSQL.Exists(sql);
        }
        public static int max(string FieldName, string TableName){
            return DbHelperSQL.GetMaxID(FieldName, TableName);

        }

        public static object GetSingle(string sql) {
            return DbHelperSQL.GetSingle(sql);
        }

        public static object GetSingle(string sql, params SqlParameter[] cmdParms) {
            return DbHelperSQL.GetSingle(sql, cmdParms);
        }

        public static int ExecuteSql(string sql)
        {
            return DbHelperSQL.ExecuteSql(sql);
        }
        public static int ExecuteSqlTranByList(List<string> SQLList) {
            return DbHelperSQL.ExecuteSqlTranByList(SQLList);
        }

        public static void ExecuteSqlTranByArrayList(ArrayList SQLList)
        {
            DbHelperSQL.ExecuteSqlTranByArrayList(SQLList);
        }

        public static DataTable getDataTable(string sql) {
            return DbHelperSQL.Query(sql).Tables[0];

        }

    }
}
